<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp" %>

<html>

 <head>
    
    <title>成本中心</title>
    <!-- import css and js -->
	<%@ include file="/common/meta.jsp" %>

		<script src="${ctx}/js/jsp/comm.js" type="text/javascript"></script>
    	<script type="text/javascript" src="${ctx}/js/jsp/yd/logic/poGatherExecute.js"></script>
	<script type="text/javascript">
		var basic_Url="${ctx}/yd/logic/logicPriceDetails";
		var basic_WUrl="/yd/logic/logicPriceDetails";
		var basic_Title="成本中心";
		var show_Width=950;
		var show_Hight=400;
		
		jQuery(document).ready(function() {
			
			//创建JQGRID表格
			var grid = $("#table1").ligerGrid({
		        columns: [
						  { display: '仓库编码', name: 'whCode', width: 150 },
		                  { display: '仓库名称', name: 'whName', width: 100 },
		                  { display: '产品编码', name: 'code', width: 150},
		                  { display: '产品名称', name: 'name', width: 150 },
		                  { display: '人民币单价', name: 'price', width: 100 },
		                  { display: '创建时间', name: 'dctime', width: 150,
		                	  render: function (item){
		                		  var cdate=new Date(item.dctime);
		                		  return formatDate(cdate,"yyyy-MM-dd");
		                	  } },
		                  { display: '创建人', name: 'dcruser', width: 150 },
		                  { display: '入库数量', name: 'quantity', width: 120 },
		                  { display: '总库存', name: 'sumquantity', width: 100 },
		                  { display: '平均单价', name: 'sumprice', width: 150 }
		                  ],  usePager: true,pageSize:15,pageSizeOptions :[15,30,45,60],enabledSort:false,
		                      url : basic_Url+"/list.do",
		                      width: '100%', height: '98%', checkbox: false,rownumbers:true
		                  });
			$("#pageloading").hide();
			
			
		});
		
		function createSearch(){
			init(2,8,'140,140,140,140','25%');
			//第一行的数据
			addCommon(0,0,"lable","产品编码");
			addCommon(0,1,"txtlike","code");
			addCommon(0,2,"lable","产品名称");
			addCommon(0,3,"txtlike","name");
			addCommon(0,4,"lable","仓库编码");
			addCommon(0,5,"txtlike","wh_code");
			addCommon(0,6,"lable","仓库");
			addCommon(0,7,"selectEnum","wh_name","<option></option><c:forEach var="s" items="${wh}"><option value='${s.name}'>${s.name}</option></c:forEach>");
		}
		function searchAP(){			
			multipleSearch("#table1",true,"",basic_Url+"/list.do");
		}
		
		function exportExcel(){
			var filtersStr = generateCondition();
			var path = basic_Url+"/exportExcelPoGather.do?filters="+filtersStr+"&_search=true";
		   	window.open(path,"_blank");
		}

	</script>
  </head>
<body onLoad="createSearch()">
   <div id="layout1">
      <div position="top">
      	 <div class="panelBar">
          	<ul class="toolBar">
				   <li><a class="export" onclick="exportExcel()"><span>导出Excel</span></a></li>
               </ul>
          </div>
          <div id="pageHeader" class="pageHeader">
               <div class="searchBar" id="multipleSearchDialog">
	                <table class="table" width="100%" id="searchHeader" >  
                        <tbody id="newbody">
                        </tbody>
 	                </table>
                    <div class="subBar">
			             <ul>
				             <li><div class="buttonActive"><div class="buttonContent"><button type="submit" id="btnSearch" onclick="searchAP()">查询</button></div></div></li>
				             <li><a class="button" onclick="clearSearch()"><span>重置</span></a></li>
			             </ul>
	                </div>
               </div>
          </div>
      </div>
      <div position="center" id="table1">
      </div>
      <div class="clear"></div>
   </div>
 
</body>
</html>